home *** CD-ROM | disk | FTP | other *** search
Text File | 2008-07-17 | 30.4 KB | 1,002 lines |
- package mx.managers
- {
- import flash.display.DisplayObject;
- import flash.display.DisplayObjectContainer;
- import flash.display.Graphics;
- import flash.display.InteractiveObject;
- import flash.display.MovieClip;
- import flash.display.Sprite;
- import flash.display.StageAlign;
- import flash.display.StageScaleMode;
- import flash.events.Event;
- import flash.events.MouseEvent;
- import flash.geom.Point;
- import flash.geom.Rectangle;
- import flash.system.ApplicationDomain;
- import flash.text.Font;
- import flash.text.TextFormat;
- import flash.ui.ContextMenu;
- import mx.core.IChildList;
- import mx.core.IFlexDisplayObject;
- import mx.core.IFlexModule;
- import mx.core.IUIComponent;
- import mx.core.Singleton;
- import mx.core.Window;
- import mx.core.mx_internal;
- import mx.events.FlexEvent;
- import mx.styles.ISimpleStyleClient;
- import mx.styles.IStyleClient;
-
- use namespace mx_internal;
-
- public class WindowedSystemManager extends MovieClip implements ISystemManager
- {
- private var _window:Window = null;
-
- mx_internal var nestLevel:int = 0;
-
- private var _topMostIndex:int = 0;
-
- private var originalSystemManager:SystemManager;
-
- private var forms:Array;
-
- private var topLevel:Boolean = true;
-
- private var mouseCatcher:Sprite;
-
- private var _height:Number;
-
- private var _cursorIndex:int = 0;
-
- mx_internal var _mouseX:*;
-
- private var _document:Object;
-
- private var _numModalWindows:int = 0;
-
- mx_internal var _mouseY:*;
-
- private var _screen:Rectangle;
-
- mx_internal var idleCounter:int = 0;
-
- private var _topLevelSystemManager:ISystemManager;
-
- private var _cursorChildren:WindowedSystemChildrenList;
-
- private var _toolTipIndex:int = 0;
-
- private var _rawChildren:WindowedSystemRawChildrenList;
-
- private var _noTopMostIndex:int = 0;
-
- private var myWindow:Window;
-
- private var form:IFocusManagerContainer;
-
- private var _width:Number;
-
- private var _toolTipChildren:WindowedSystemChildrenList;
-
- private var initialized:Boolean = false;
-
- private var _focusPane:Sprite;
-
- private var _fontList:Object = null;
-
- private var _popUpChildren:WindowedSystemChildrenList;
-
- mx_internal var topLevelWindow:IUIComponent;
-
- public function WindowedSystemManager(param1:IUIComponent)
- {
- forms = [];
- super();
- _topLevelSystemManager = this;
- mx_internal::topLevelWindow = param1;
- SystemManagerGlobals.topLevelSystemManagers.push(this);
- addEventListener(Event.ADDED,docFrameHandler);
- }
-
- mx_internal function rawChildren_removeChild(param1:DisplayObject) : DisplayObject
- {
- mx_internal::removingChild(param1);
- super.removeChild(param1);
- mx_internal::childRemoved(param1);
- return param1;
- }
-
- final mx_internal function get $numChildren() : int
- {
- return super.numChildren;
- }
-
- public function get toolTipChildren() : IChildList
- {
- if(!topLevel)
- {
- return _topLevelSystemManager.toolTipChildren;
- }
- if(!_toolTipChildren)
- {
- _toolTipChildren = new WindowedSystemChildrenList(this,new QName(mx_internal,"topMostIndex"),new QName(mx_internal,"toolTipIndex"));
- }
- return _toolTipChildren;
- }
-
- override public function removeChild(param1:DisplayObject) : DisplayObject
- {
- --mx_internal::noTopMostIndex;
- return mx_internal::rawChildren_removeChild(param1);
- }
-
- override public function addChild(param1:DisplayObject) : DisplayObject
- {
- ++mx_internal::noTopMostIndex;
- return mx_internal::rawChildren_addChildAt(param1,mx_internal::noTopMostIndex - 1);
- }
-
- public function activate(param1:IFocusManagerContainer) : void
- {
- var _loc2_:IFocusManagerContainer = null;
- if(form)
- {
- if(form != param1 && forms.length > 1)
- {
- _loc2_ = form;
- _loc2_.focusManager.deactivate();
- }
- }
- form = param1;
- if(param1.focusManager)
- {
- param1.focusManager.activate();
- }
- }
-
- mx_internal function rawChildren_getObjectsUnderPoint(param1:Point) : Array
- {
- return super.getObjectsUnderPoint(param1);
- }
-
- mx_internal function rawChildren_getChildIndex(param1:DisplayObject) : int
- {
- return super.getChildIndex(param1);
- }
-
- public function get document() : Object
- {
- return _document;
- }
-
- mx_internal function get cursorIndex() : int
- {
- return _cursorIndex;
- }
-
- override public function getChildIndex(param1:DisplayObject) : int
- {
- return super.getChildIndex(param1);
- }
-
- override public function getObjectsUnderPoint(param1:Point) : Array
- {
- var _loc5_:DisplayObject = null;
- var _loc6_:Array = null;
- var _loc2_:Array = [];
- var _loc3_:int = mx_internal::topMostIndex;
- var _loc4_:int = 0;
- while(_loc4_ < _loc3_)
- {
- _loc5_ = super.getChildAt(_loc4_);
- if(_loc5_ is DisplayObjectContainer)
- {
- _loc6_ = DisplayObjectContainer(_loc5_).getObjectsUnderPoint(param1);
- if(_loc6_)
- {
- _loc2_ = _loc2_.concat(_loc6_);
- }
- }
- _loc4_++;
- }
- return _loc2_;
- }
-
- final mx_internal function $addChild(param1:DisplayObject) : DisplayObject
- {
- return super.addChild(param1);
- }
-
- mx_internal function notifyStyleChangeInChildren(param1:String, param2:Boolean) : void
- {
- var _loc6_:IStyleClient = null;
- var _loc3_:Boolean = false;
- var _loc4_:int = int(rawChildren.numChildren);
- var _loc5_:int = 0;
- while(_loc5_ < _loc4_)
- {
- _loc6_ = rawChildren.getChildAt(_loc5_) as IStyleClient;
- if(_loc6_)
- {
- _loc6_.styleChanged(param1);
- _loc6_.notifyStyleChangeInChildren(param1,param2);
- }
- if(isTopLevelWindow(DisplayObject(_loc6_)))
- {
- _loc3_ = true;
- }
- _loc4_ = int(rawChildren.numChildren);
- _loc5_++;
- }
- if(!_loc3_ && mx_internal::topLevelWindow is IStyleClient)
- {
- IStyleClient(mx_internal::topLevelWindow).styleChanged(param1);
- IStyleClient(mx_internal::topLevelWindow).notifyStyleChangeInChildren(param1,param2);
- }
- }
-
- mx_internal function rawChildren_addChild(param1:DisplayObject) : DisplayObject
- {
- mx_internal::addingChild(param1);
- super.addChild(param1);
- mx_internal::childAdded(param1);
- return param1;
- }
-
- override public function get height() : Number
- {
- return _height;
- }
-
- override public function setChildIndex(param1:DisplayObject, param2:int) : void
- {
- super.setChildIndex(param1,Math.min(mx_internal::noTopMostIndex + param2,numChildren - 1));
- }
-
- mx_internal function regenerateStyleCache(param1:Boolean) : void
- {
- var _loc5_:IStyleClient = null;
- var _loc2_:Boolean = false;
- var _loc3_:int = int(rawChildren.numChildren);
- var _loc4_:int = 0;
- while(_loc4_ < _loc3_)
- {
- _loc5_ = rawChildren.getChildAt(_loc4_) as IStyleClient;
- if(_loc5_)
- {
- _loc5_.regenerateStyleCache(param1);
- }
- if(isTopLevelWindow(DisplayObject(_loc5_)))
- {
- _loc2_ = true;
- }
- _loc3_ = int(rawChildren.numChildren);
- _loc4_++;
- }
- if(!_loc2_ && mx_internal::topLevelWindow is IStyleClient)
- {
- IStyleClient(mx_internal::topLevelWindow).regenerateStyleCache(param1);
- }
- }
-
- mx_internal function addingChild(param1:DisplayObject) : void
- {
- var _loc4_:DisplayObjectContainer = null;
- var _loc2_:int = 1;
- if(!topLevel)
- {
- _loc4_ = parent.parent;
- while(_loc4_)
- {
- if(_loc4_ is ILayoutManagerClient)
- {
- _loc2_ = ILayoutManagerClient(_loc4_).nestLevel + 1;
- break;
- }
- _loc4_ = _loc4_.parent;
- }
- }
- mx_internal::nestLevel = _loc2_;
- if(param1 is IUIComponent)
- {
- IUIComponent(param1).systemManager = this;
- }
- var _loc3_:Class = Class(getDefinitionByName("mx.core.UIComponent"));
- if(param1 is IUIComponent && !IUIComponent(param1).document)
- {
- IUIComponent(param1).document = document;
- }
- if(param1 is ILayoutManagerClient)
- {
- ILayoutManagerClient(param1).nestLevel = mx_internal::nestLevel + 1;
- }
- if(param1 is InteractiveObject)
- {
- if(doubleClickEnabled)
- {
- InteractiveObject(param1).doubleClickEnabled = true;
- }
- }
- if(param1 is IUIComponent)
- {
- IUIComponent(param1).parentChanged(this);
- }
- if(param1 is IStyleClient)
- {
- IStyleClient(param1).regenerateStyleCache(true);
- }
- if(param1 is ISimpleStyleClient)
- {
- ISimpleStyleClient(param1).styleChanged(null);
- }
- if(param1 is IStyleClient)
- {
- IStyleClient(param1).notifyStyleChangeInChildren(null,true);
- }
- if(Boolean(_loc3_) && param1 is _loc3_)
- {
- _loc3_(param1).initThemeColor();
- }
- if(Boolean(_loc3_) && param1 is _loc3_)
- {
- _loc3_(param1).stylesInitialized();
- }
- }
-
- public function get embeddedFontList() : Object
- {
- var _loc1_:Object = null;
- var _loc2_:String = null;
- var _loc3_:Object = null;
- if(_fontList == null)
- {
- _fontList = {};
- _loc1_ = info()["fonts"];
- for(_loc2_ in _loc1_)
- {
- _fontList[_loc2_] = _loc1_[_loc2_];
- }
- if(!topLevel && Boolean(_topLevelSystemManager))
- {
- _loc3_ = _topLevelSystemManager.embeddedFontList;
- for(_loc2_ in _loc3_)
- {
- _fontList[_loc2_] = _loc3_[_loc2_];
- }
- }
- }
- return _fontList;
- }
-
- mx_internal function set cursorIndex(param1:int) : void
- {
- var _loc2_:int = param1 - _cursorIndex;
- _cursorIndex = param1;
- }
-
- mx_internal function get topMostIndex() : int
- {
- return _topMostIndex;
- }
-
- public function set document(param1:Object) : void
- {
- _document = param1;
- }
-
- public function isFontFaceEmbedded(param1:TextFormat) : Boolean
- {
- var _loc6_:Font = null;
- var _loc7_:String = null;
- var _loc2_:String = param1.font;
- var _loc3_:Array = Font.enumerateFonts();
- var _loc4_:int = 0;
- while(_loc4_ < _loc3_.length)
- {
- _loc6_ = Font(_loc3_[_loc4_]);
- if(_loc6_.fontName == _loc2_)
- {
- _loc7_ = "regular";
- if(Boolean(param1.bold) && Boolean(param1.italic))
- {
- _loc7_ = "boldItalic";
- }
- else if(param1.bold)
- {
- _loc7_ = "bold";
- }
- else if(param1.italic)
- {
- _loc7_ = "italic";
- }
- if(_loc6_.fontStyle == _loc7_)
- {
- return true;
- }
- }
- _loc4_++;
- }
- if(!_loc2_ || !embeddedFontList || !embeddedFontList[_loc2_])
- {
- return false;
- }
- var _loc5_:Object = embeddedFontList[_loc2_];
- return !(Boolean(param1.bold) && !_loc5_.bold || Boolean(param1.italic) && !_loc5_.italic || !param1.bold && !param1.italic && !_loc5_.regular);
- }
-
- mx_internal function rawChildren_setChildIndex(param1:DisplayObject, param2:int) : void
- {
- super.setChildIndex(param1,param2);
- }
-
- private function resizeMouseCatcher() : void
- {
- var _loc1_:Graphics = null;
- if(mouseCatcher)
- {
- _loc1_ = mouseCatcher.graphics;
- _loc1_.clear();
- _loc1_.beginFill(0,0);
- _loc1_.drawRect(0,0,stage.stageWidth,stage.stageHeight);
- _loc1_.endFill();
- }
- }
-
- mx_internal function set noTopMostIndex(param1:int) : void
- {
- var _loc2_:int = param1 - _noTopMostIndex;
- _noTopMostIndex = param1;
- mx_internal::topMostIndex += _loc2_;
- }
-
- public function get rawChildren() : IChildList
- {
- if(!topLevel)
- {
- return _topLevelSystemManager.rawChildren;
- }
- if(!_rawChildren)
- {
- _rawChildren = new WindowedSystemRawChildrenList(this);
- }
- return _rawChildren;
- }
-
- override public function getChildAt(param1:int) : DisplayObject
- {
- return super.getChildAt(mx_internal::noTopMostIndex + param1);
- }
-
- mx_internal function rawChildren_getChildAt(param1:int) : DisplayObject
- {
- return super.getChildAt(param1);
- }
-
- mx_internal function rawChildren_contains(param1:DisplayObject) : Boolean
- {
- return super.contains(param1);
- }
-
- override public function removeChildAt(param1:int) : DisplayObject
- {
- --mx_internal::noTopMostIndex;
- return mx_internal::rawChildren_removeChildAt(mx_internal::noTopMostIndex + param1);
- }
-
- mx_internal function childAdded(param1:DisplayObject) : void
- {
- param1.dispatchEvent(new FlexEvent(FlexEvent.ADD));
- if(param1 is IUIComponent)
- {
- IUIComponent(param1).initialize();
- }
- }
-
- final mx_internal function $removeChild(param1:DisplayObject) : DisplayObject
- {
- return super.removeChild(param1);
- }
-
- private function Stage_resizeHandler(param1:Event = null) : void
- {
- var _loc2_:Number = stage.stageWidth;
- var _loc3_:Number = stage.stageHeight;
- var _loc4_:Number = 0;
- var _loc5_:Number = 0;
- if(!_screen)
- {
- _screen = new Rectangle();
- }
- _screen.x = _loc5_;
- _screen.y = _loc4_;
- _screen.width = _loc2_;
- _screen.height = _loc3_;
- _width = stage.stageWidth;
- _height = stage.stageHeight;
- if(param1)
- {
- resizeMouseCatcher();
- dispatchEvent(param1);
- }
- }
-
- public function getDefinitionByName(param1:String) : Object
- {
- var _loc3_:Object = null;
- var _loc2_:ApplicationDomain = ApplicationDomain.currentDomain;
- if(_loc2_.hasDefinition(param1))
- {
- _loc3_ = _loc2_.getDefinition(param1);
- }
- return _loc3_;
- }
-
- public function removeFocusManager(param1:IFocusManagerContainer) : void
- {
- var _loc2_:int = int(forms.length);
- var _loc3_:int = 0;
- while(_loc3_ < _loc2_)
- {
- if(forms[_loc3_] == param1)
- {
- if(form == param1)
- {
- deactivate(param1);
- }
- forms.splice(_loc3_,1);
- return;
- }
- _loc3_++;
- }
- }
-
- mx_internal function removingChild(param1:DisplayObject) : void
- {
- param1.dispatchEvent(new FlexEvent(FlexEvent.REMOVE));
- }
-
- public function get focusPane() : Sprite
- {
- return _focusPane;
- }
-
- mx_internal function rawChildren_removeChildAt(param1:int) : DisplayObject
- {
- var _loc2_:DisplayObject = super.getChildAt(param1);
- mx_internal::removingChild(_loc2_);
- super.removeChildAt(param1);
- mx_internal::childRemoved(_loc2_);
- return _loc2_;
- }
-
- private function mouseDownHandler(param1:MouseEvent) : void
- {
- var _loc2_:int = 0;
- var _loc3_:DisplayObject = null;
- var _loc4_:Boolean = false;
- var _loc5_:int = 0;
- var _loc6_:int = 0;
- var _loc7_:int = 0;
- var _loc8_:int = 0;
- var _loc9_:IChildList = null;
- mx_internal::idleCounter = 0;
- if(numModalWindows == 0)
- {
- if(forms.length > 1)
- {
- _loc2_ = int(forms.length);
- _loc3_ = DisplayObject(param1.target);
- _loc4_ = Boolean(document.rawChildren.contains(_loc3_));
- while(_loc3_)
- {
- _loc5_ = 0;
- while(_loc5_ < _loc2_)
- {
- if(forms[_loc5_] == _loc3_)
- {
- _loc6_ = 0;
- if(_loc3_ != form && _loc3_ is IFocusManagerContainer)
- {
- activate(IFocusManagerContainer(_loc3_));
- }
- if(popUpChildren.contains(_loc3_))
- {
- _loc9_ = popUpChildren;
- }
- else
- {
- _loc9_ = this;
- }
- _loc8_ = _loc7_ = int(_loc9_.getChildIndex(_loc3_));
- _loc2_ = int(forms.length);
- _loc6_ = 0;
- while(_loc6_ < _loc2_)
- {
- if(_loc9_.contains(forms[_loc6_]))
- {
- if(_loc9_.getChildIndex(forms[_loc6_]) > _loc7_)
- {
- _loc8_ = int(_loc9_.getChildIndex(forms[_loc6_]));
- }
- }
- _loc6_++;
- }
- if(_loc8_ > _loc7_ && !_loc4_)
- {
- _loc9_.setChildIndex(_loc3_,_loc8_);
- }
- return;
- }
- _loc5_++;
- }
- _loc3_ = _loc3_.parent;
- }
- }
- }
- }
-
- override public function get mouseX() : Number
- {
- if(mx_internal::_mouseX === undefined)
- {
- return super.mouseX;
- }
- return mx_internal::_mouseX;
- }
-
- public function get screen() : Rectangle
- {
- if(!_screen)
- {
- _screen = new Rectangle();
- }
- _screen.x = 0;
- _screen.y = 0;
- _screen.width = stage.stageWidth;
- _screen.height = stage.stageHeight;
- return _screen;
- }
-
- mx_internal function set toolTipIndex(param1:int) : void
- {
- var _loc2_:int = param1 - _toolTipIndex;
- _toolTipIndex = param1;
- mx_internal::cursorIndex += _loc2_;
- }
-
- override public function get mouseY() : Number
- {
- if(mx_internal::_mouseY === undefined)
- {
- return super.mouseY;
- }
- return mx_internal::_mouseY;
- }
-
- public function set numModalWindows(param1:int) : void
- {
- _numModalWindows = param1;
- }
-
- public function isTopLevel() : Boolean
- {
- return topLevel;
- }
-
- mx_internal function set topMostIndex(param1:int) : void
- {
- var _loc2_:int = param1 - _topMostIndex;
- _topMostIndex = param1;
- mx_internal::toolTipIndex += _loc2_;
- }
-
- public function get cursorChildren() : IChildList
- {
- if(!topLevel)
- {
- return _topLevelSystemManager.cursorChildren;
- }
- if(!_cursorChildren)
- {
- _cursorChildren = new WindowedSystemChildrenList(this,new QName(mx_internal,"toolTipIndex"),new QName(mx_internal,"cursorIndex"));
- }
- return _cursorChildren;
- }
-
- private function initContextMenu() : void
- {
- var _loc1_:ContextMenu = new ContextMenu();
- _loc1_.hideBuiltInItems();
- _loc1_.builtInItems.print = true;
- contextMenu = _loc1_;
- }
-
- public function deactivate(param1:IFocusManagerContainer) : void
- {
- var _loc2_:IFocusManagerContainer = null;
- var _loc3_:int = 0;
- var _loc4_:int = 0;
- var _loc5_:IFocusManagerContainer = null;
- if(form)
- {
- if(form == param1 && forms.length > 1)
- {
- form.focusManager.deactivate();
- _loc3_ = int(forms.length);
- _loc4_ = 0;
- while(_loc4_ < _loc3_)
- {
- _loc5_ = forms[_loc4_];
- if(_loc5_ == param1)
- {
- _loc4_ += 1;
- while(_loc4_ < _loc3_)
- {
- _loc5_ = forms[_loc4_];
- if(Sprite(_loc5_).visible == true && Boolean(IUIComponent(_loc5_).enabled))
- {
- _loc2_ = _loc5_;
- }
- _loc4_++;
- }
- form = _loc2_;
- break;
- }
- if(Sprite(_loc5_).visible && Boolean(IUIComponent(_loc5_).enabled))
- {
- _loc2_ = _loc5_;
- }
- _loc4_++;
- }
- if(form)
- {
- form.focusManager.activate();
- }
- }
- }
- }
-
- protected function docFrameHandler(param1:Event = null) : void
- {
- var _loc3_:int = 0;
- var _loc4_:int = 0;
- var _loc5_:Class = null;
- removeEventListener(Event.ADDED,docFrameHandler);
- if(stage)
- {
- stage.scaleMode = StageScaleMode.NO_SCALE;
- stage.align = StageAlign.TOP_LEFT;
- }
- var _loc2_:Array = info()["mixins"];
- if(Boolean(_loc2_) && _loc2_.length > 0)
- {
- _loc3_ = int(_loc2_.length);
- _loc4_ = 0;
- while(_loc4_ < _loc3_)
- {
- _loc5_ = Class(getDefinitionByName(_loc2_[_loc4_]));
- _loc5_["init"](this);
- _loc4_++;
- }
- }
- initializeTopLevelWindow(null);
- if(Singleton.getClass("mx.managers::IDragManager").getInstance() is NativeDragManagerImpl)
- {
- NativeDragManagerImpl(Singleton.getClass("mx.managers::IDragManager").getInstance()).mx_internal::registerSystemManager(this);
- }
- }
-
- public function get topLevelSystemManager() : ISystemManager
- {
- if(topLevel)
- {
- return this;
- }
- return _topLevelSystemManager;
- }
-
- mx_internal function rawChildren_getChildByName(param1:String) : DisplayObject
- {
- return super.getChildByName(param1);
- }
-
- mx_internal function get noTopMostIndex() : int
- {
- return _noTopMostIndex;
- }
-
- mx_internal function childRemoved(param1:DisplayObject) : void
- {
- if(param1 is IUIComponent)
- {
- IUIComponent(param1).parentChanged(null);
- }
- }
-
- override public function addChildAt(param1:DisplayObject, param2:int) : DisplayObject
- {
- ++mx_internal::noTopMostIndex;
- return mx_internal::rawChildren_addChildAt(param1,param2);
- }
-
- final mx_internal function $removeChildAt(param1:int) : DisplayObject
- {
- return super.removeChildAt(param1);
- }
-
- override public function getChildByName(param1:String) : DisplayObject
- {
- return super.getChildByName(param1);
- }
-
- mx_internal function cleanup(param1:Event) : void
- {
- if(NativeDragManagerImpl(Singleton.getClass("mx.managers::IDragManager").getInstance()) is NativeDragManagerImpl)
- {
- NativeDragManagerImpl(Singleton.getClass("mx.managers::IDragManager").getInstance()).mx_internal::unregisterSystemManager(this);
- }
- SystemManagerGlobals.topLevelSystemManagers.splice(SystemManagerGlobals.topLevelSystemManagers.indexOf(this),1);
- myWindow.removeEventListener("close",mx_internal::cleanup);
- myWindow = null;
- }
-
- public function info() : Object
- {
- return {};
- }
-
- mx_internal function get toolTipIndex() : int
- {
- return _toolTipIndex;
- }
-
- final mx_internal function $addChildAt(param1:DisplayObject, param2:int) : DisplayObject
- {
- return super.addChildAt(param1,param2);
- }
-
- mx_internal function rawChildren_addChildAt(param1:DisplayObject, param2:int) : DisplayObject
- {
- mx_internal::addingChild(param1);
- super.addChildAt(param1,param2);
- mx_internal::childAdded(param1);
- return param1;
- }
-
- protected function initializeTopLevelWindow(param1:Event) : void
- {
- var _loc2_:IUIComponent = null;
- var _loc3_:DisplayObjectContainer = null;
- initialized = true;
- if(!parent)
- {
- return;
- }
- initContextMenu();
- if(!topLevel)
- {
- _loc3_ = parent.parent;
- if(!_loc3_)
- {
- return;
- }
- while(_loc3_)
- {
- if(_loc3_ is IUIComponent)
- {
- _topLevelSystemManager = IUIComponent(_loc3_).systemManager;
- break;
- }
- _loc3_ = _loc3_.parent;
- }
- }
- addEventListener(MouseEvent.MOUSE_DOWN,mouseDownHandler,true);
- stage.addEventListener(Event.RESIZE,Stage_resizeHandler,false,0,true);
- document = _loc2_ = mx_internal::topLevelWindow;
- if(document)
- {
- if(topLevel && Boolean(stage))
- {
- _width = stage.stageWidth;
- _height = stage.stageHeight;
- IFlexDisplayObject(_loc2_).setActualSize(stage.stageWidth,stage.stageHeight);
- }
- else
- {
- IFlexDisplayObject(_loc2_).setActualSize(loaderInfo.width,loaderInfo.height);
- }
- mx_internal::addingChild(DisplayObject(_loc2_));
- mx_internal::childAdded(DisplayObject(_loc2_));
- }
- else
- {
- document = this;
- }
- }
-
- public function set focusPane(param1:Sprite) : void
- {
- if(param1)
- {
- addChild(param1);
- param1.x = 0;
- param1.y = 0;
- param1.scrollRect = null;
- _focusPane = param1;
- }
- else
- {
- removeChild(_focusPane);
- _focusPane = null;
- }
- }
-
- override public function get width() : Number
- {
- return _width;
- }
-
- public function isTopLevelWindow(param1:DisplayObject) : Boolean
- {
- return param1 is IUIComponent && IUIComponent(param1) == mx_internal::topLevelWindow;
- }
-
- public function get numModalWindows() : int
- {
- return _numModalWindows;
- }
-
- mx_internal function set window(param1:Window) : void
- {
- _window = param1;
- }
-
- public function get popUpChildren() : IChildList
- {
- if(!topLevel)
- {
- return _topLevelSystemManager.popUpChildren;
- }
- if(!_popUpChildren)
- {
- _popUpChildren = new WindowedSystemChildrenList(this,new QName(mx_internal,"noTopMostIndex"),new QName(mx_internal,"topMostIndex"));
- }
- return _popUpChildren;
- }
-
- mx_internal function get window() : Window
- {
- return _window;
- }
-
- mx_internal function addWindow(param1:Window) : void
- {
- myWindow = param1;
- myWindow.nativeWindow.addEventListener("close",mx_internal::cleanup);
- }
-
- public function addFocusManager(param1:IFocusManagerContainer) : void
- {
- forms.push(param1);
- }
-
- public function create(... rest) : Object
- {
- var _loc2_:String = String(rest[0]);
- var _loc3_:Class = Class(getDefinitionByName(_loc2_));
- if(!_loc3_)
- {
- throw new Error("Class \'" + _loc2_ + "\' not found.");
- }
- var _loc4_:Object = new _loc3_();
- if(_loc4_ is IFlexModule)
- {
- IFlexModule(_loc4_).moduleFactory = this;
- }
- return _loc4_;
- }
- }
- }
-
-